package com.itheima.jz;

public class Demo3yihuo {
    public static void main(String[] args) {

        int a = 10;
        int b = 20;

        int temp = a;
        a = b;
        b = temp;
        System.out.println(a);
        System.out.println(b);

        int c = 99;
        int d = 89;
//面试题 不加第三方变量 通过异或的方式解决
        //一个数被另一个数异或两次 结果为其本身
        c = c ^ d;
        d = c ^ d;
        c = c ^ d;
        System.out.println(c);
        System.out.println(d);
    }
}
